package com.mkyong.controller;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean//(name="payment")
@SessionScoped
public class PaymentController implements Serializable {
	private static final long serialVersionUID = 1L;
	
	public boolean registerCompleted = false;
	public int orderQty = 199;
	
	public int getOrderQty() {
		return orderQty;
	}
	
	public void setOrderQty(int orderQty) {
		this.orderQty = orderQty;
	}
	
	public boolean isRegisterCompleted() {
		return registerCompleted;
	}
	
	public void setRegisterCompleted(boolean registerCompleted) {
		this.registerCompleted = registerCompleted;
	}
	
	public String goPaymentPage() {		
		if(orderQty < 100) {
			return "ordermore";
		} else if(registerCompleted) {
			return "payment";
		} else {
			return "register";
		}
	}
}
